﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class List_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //Bind();
            Bind2();
        }
    }
    
    private void Bind()
    { 
        GetValue<int> v1 = new GetValue<int>();
        v1.thisValue = 10;
        Label1.Text = v1.returnValue().ToString();

        GetValue<string> v2 = new GetValue<string>();
        v2.thisValue = "hello world";
        Label2.Text = v2.returnValue().ToString();
    }

    private void Bind2()
    {
        string str = "abcdefg";
        char c1 = str.ToCharArray()[1];
        Label1.Text = c1.ToString();

        System.Nullable<int> nullableint = new System.Nullable<int>();
        nullableint = null;
        Label2.Text = nullableint.HasValue ? nullableint.ToString() : "NULL";
        Label2.Text = nullableint.ToString() ?? "NULL";
    }

    private class GetValue<T> where T : IComparable
    {
        public T thisValue;
        public T returnValue()
        {
            return thisValue;
        }
    }

    private class MyList<T> where T : IQueryable
    {
        private T _value;
        protected List<T> GetEntities()
        {

            List<T> t = new List<T>();
            return t;
        }        
    }


}
